Integrand size = 41, antiderivative size = 175 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {1}{8} \left (8 a b B+4 b^2 (A+2 C)+a^2 (3 A+4 C)\right ) x+\frac {\left (4 a A b+2 a^2 B+3 b^2 B+6 a b C\right ) \sin (c+d x)}{3 d}+\frac {\left (2 A b^2+8 a b B+a^2 (3 A+4 C)\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (A b+2 a B) \cos ^2(c+d x) \sin (c+d x)}{6 d}+\frac {A \cos ^3(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{4 d} \]
[Out]
Time = 0.53 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.146, Rules used = {4179, 4159, 4132, 2717, 4130, 8} \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {\sin (c+d x) \left (2 a^2 B+4 a A b+6 a b C+3 b^2 B\right )}{3 d}+\frac {\sin (c+d x) \cos (c+d x) \left (a^2 (3 A+4 C)+8 a b B+2 A b^2\right )}{8 d}+\frac {1}{8} x \left (a^2 (3 A+4 C)+8 a b B+4 b^2 (A+2 C)\right )+\frac {a (2 a B+A b) \sin (c+d x) \cos ^2(c+d x)}{6 d}+\frac {A \sin (c+d x) \cos ^3(c+d x) (a+b \sec (c+d x))^2}{4 d} \]
[In]
[Out]
Rule 8
Rule 2717
Rule 4130
Rule 4132
Rule 4159
Rule 4179
Rubi steps \begin{align*} \text {integral}& = \frac {A \cos ^3(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{4 d}+\frac {1}{4} \int \cos ^3(c+d x) (a+b \sec (c+d x)) \left (2 (A b+2 a B)+(3 a A+4 b B+4 a C) \sec (c+d x)+b (A+4 C) \sec ^2(c+d x)\right ) \, dx \\ & = \frac {a (A b+2 a B) \cos ^2(c+d x) \sin (c+d x)}{6 d}+\frac {A \cos ^3(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{4 d}-\frac {1}{12} \int \cos ^2(c+d x) \left (-3 \left (2 A b^2+8 a b B+a^2 (3 A+4 C)\right )-4 \left (4 a A b+2 a^2 B+3 b^2 B+6 a b C\right ) \sec (c+d x)-3 b^2 (A+4 C) \sec ^2(c+d x)\right ) \, dx \\ & = \frac {a (A b+2 a B) \cos ^2(c+d x) \sin (c+d x)}{6 d}+\frac {A \cos ^3(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{4 d}-\frac {1}{12} \int \cos ^2(c+d x) \left (-3 \left (2 A b^2+8 a b B+a^2 (3 A+4 C)\right )-3 b^2 (A+4 C) \sec ^2(c+d x)\right ) \, dx-\frac {1}{3} \left (-4 a A b-2 a^2 B-3 b^2 B-6 a b C\right ) \int \cos (c+d x) \, dx \\ & = \frac {\left (4 a A b+2 a^2 B+3 b^2 B+6 a b C\right ) \sin (c+d x)}{3 d}+\frac {\left (2 A b^2+8 a b B+a^2 (3 A+4 C)\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (A b+2 a B) \cos ^2(c+d x) \sin (c+d x)}{6 d}+\frac {A \cos ^3(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{4 d}-\frac {1}{8} \left (-8 a b B-4 b^2 (A+2 C)-a^2 (3 A+4 C)\right ) \int 1 \, dx \\ & = \frac {1}{8} \left (8 a b B+4 b^2 (A+2 C)+a^2 (3 A+4 C)\right ) x+\frac {\left (4 a A b+2 a^2 B+3 b^2 B+6 a b C\right ) \sin (c+d x)}{3 d}+\frac {\left (2 A b^2+8 a b B+a^2 (3 A+4 C)\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (A b+2 a B) \cos ^2(c+d x) \sin (c+d x)}{6 d}+\frac {A \cos ^3(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{4 d} \\ \end{align*}
Time = 2.29 (sec) , antiderivative size = 134, normalized size of antiderivative = 0.77 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {12 \left (8 a b B+4 b^2 (A+2 C)+a^2 (3 A+4 C)\right ) (c+d x)+24 \left (6 a A b+3 a^2 B+4 b^2 B+8 a b C\right ) \sin (c+d x)+24 \left (A b^2+2 a b B+a^2 (A+C)\right ) \sin (2 (c+d x))+8 a (2 A b+a B) \sin (3 (c+d x))+3 a^2 A \sin (4 (c+d x))}{96 d} \]
[In]
[Out]
Time = 0.62 (sec) , antiderivative size = 132, normalized size of antiderivative = 0.75
method | result | size |
parallelrisch | \(\frac {24 \left (\left (A +C \right ) a^{2}+2 B a b +A \,b^{2}\right ) \sin \left (2 d x +2 c \right )+8 \left (2 a A b +B \,a^{2}\right ) \sin \left (3 d x +3 c \right )+3 a^{2} A \sin \left (4 d x +4 c \right )+24 \left (3 B \,a^{2}+6 a \left (A +\frac {4 C}{3}\right ) b +4 B \,b^{2}\right ) \sin \left (d x +c \right )+36 \left (\left (A +\frac {4 C}{3}\right ) a^{2}+\frac {8 B a b}{3}+\frac {4 b^{2} \left (A +2 C \right )}{3}\right ) d x}{96 d}\) | \(132\) |
derivativedivides | \(\frac {a^{2} A \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {2 a A b \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+\frac {B \,a^{2} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+A \,b^{2} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 B a b \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C \,a^{2} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \,b^{2} \sin \left (d x +c \right )+2 C a b \sin \left (d x +c \right )+C \,b^{2} \left (d x +c \right )}{d}\) | \(200\) |
default | \(\frac {a^{2} A \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {2 a A b \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+\frac {B \,a^{2} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+A \,b^{2} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 B a b \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C \,a^{2} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \,b^{2} \sin \left (d x +c \right )+2 C a b \sin \left (d x +c \right )+C \,b^{2} \left (d x +c \right )}{d}\) | \(200\) |
risch | \(\frac {3 a^{2} A x}{8}+\frac {x A \,b^{2}}{2}+x B a b +\frac {a^{2} x C}{2}+x C \,b^{2}+\frac {3 a A b \sin \left (d x +c \right )}{2 d}+\frac {3 a^{2} B \sin \left (d x +c \right )}{4 d}+\frac {\sin \left (d x +c \right ) B \,b^{2}}{d}+\frac {2 \sin \left (d x +c \right ) C a b}{d}+\frac {a^{2} A \sin \left (4 d x +4 c \right )}{32 d}+\frac {\sin \left (3 d x +3 c \right ) a A b}{6 d}+\frac {\sin \left (3 d x +3 c \right ) B \,a^{2}}{12 d}+\frac {a^{2} A \sin \left (2 d x +2 c \right )}{4 d}+\frac {\sin \left (2 d x +2 c \right ) A \,b^{2}}{4 d}+\frac {\sin \left (2 d x +2 c \right ) B a b}{2 d}+\frac {\sin \left (2 d x +2 c \right ) C \,a^{2}}{4 d}\) | \(215\) |
norman | \(\frac {\left (-\frac {3}{8} a^{2} A -\frac {1}{2} A \,b^{2}-B a b -\frac {1}{2} C \,a^{2}-C \,b^{2}\right ) x +\left (-\frac {9}{8} a^{2} A -\frac {3}{2} A \,b^{2}-3 B a b -\frac {3}{2} C \,a^{2}-3 C \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (-\frac {9}{8} a^{2} A -\frac {3}{2} A \,b^{2}-3 B a b -\frac {3}{2} C \,a^{2}-3 C \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\left (-\frac {3}{8} a^{2} A -\frac {1}{2} A \,b^{2}-B a b -\frac {1}{2} C \,a^{2}-C \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (\frac {3}{8} a^{2} A +\frac {1}{2} A \,b^{2}+B a b +\frac {1}{2} C \,a^{2}+C \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}+\left (\frac {3}{8} a^{2} A +\frac {1}{2} A \,b^{2}+B a b +\frac {1}{2} C \,a^{2}+C \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{14}+\left (\frac {9}{8} a^{2} A +\frac {3}{2} A \,b^{2}+3 B a b +\frac {3}{2} C \,a^{2}+3 C \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (\frac {9}{8} a^{2} A +\frac {3}{2} A \,b^{2}+3 B a b +\frac {3}{2} C \,a^{2}+3 C \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\frac {\left (7 a^{2} A -4 A \,b^{2}-8 B a b -4 C \,a^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}+\frac {\left (27 a^{2} A -32 a A b +12 A \,b^{2}-16 B \,a^{2}+24 B a b +12 C \,a^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{6 d}+\frac {\left (27 a^{2} A +32 a A b +12 A \,b^{2}+16 B \,a^{2}+24 B a b +12 C \,a^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{6 d}-\frac {\left (5 a^{2} A -16 a A b +4 A \,b^{2}-8 B \,a^{2}+8 B a b -8 B \,b^{2}+4 C \,a^{2}-16 C a b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{13}}{4 d}-\frac {\left (5 a^{2} A +16 a A b +4 A \,b^{2}+8 B \,a^{2}+8 B a b +8 B \,b^{2}+4 C \,a^{2}+16 C a b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {\left (81 a^{2} A -16 a A b -12 A \,b^{2}-8 B \,a^{2}-24 B a b -72 B \,b^{2}-12 C \,a^{2}-144 C a b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{12 d}-\frac {\left (81 a^{2} A +16 a A b -12 A \,b^{2}+8 B \,a^{2}-24 B a b +72 B \,b^{2}-12 C \,a^{2}+144 C a b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{12 d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{3}}\) | \(749\) |
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 134, normalized size of antiderivative = 0.77 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {3 \, {\left ({\left (3 \, A + 4 \, C\right )} a^{2} + 8 \, B a b + 4 \, {\left (A + 2 \, C\right )} b^{2}\right )} d x + {\left (6 \, A a^{2} \cos \left (d x + c\right )^{3} + 16 \, B a^{2} + 16 \, {\left (2 \, A + 3 \, C\right )} a b + 24 \, B b^{2} + 8 \, {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left ({\left (3 \, A + 4 \, C\right )} a^{2} + 8 \, B a b + 4 \, A b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d} \]
[In]
[Out]
Timed out. \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\text {Timed out} \]
[In]
[Out]
none
Time = 0.24 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.07 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{2} - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a^{2} + 24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a^{2} - 64 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a b + 48 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a b + 24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A b^{2} + 96 \, {\left (d x + c\right )} C b^{2} + 192 \, C a b \sin \left (d x + c\right ) + 96 \, B b^{2} \sin \left (d x + c\right )}{96 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 577 vs. \(2 (165) = 330\).
Time = 0.31 (sec) , antiderivative size = 577, normalized size of antiderivative = 3.30 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {3 \, {\left (3 \, A a^{2} + 4 \, C a^{2} + 8 \, B a b + 4 \, A b^{2} + 8 \, C b^{2}\right )} {\left (d x + c\right )} - \frac {2 \, {\left (15 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 12 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 48 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 48 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 9 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 80 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 144 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 72 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 9 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 12 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 80 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 144 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 72 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 15 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 48 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 48 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4}}}{24 \, d} \]
[In]
[Out]
Time = 16.57 (sec) , antiderivative size = 214, normalized size of antiderivative = 1.22 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {3\,A\,a^2\,x}{8}+\frac {A\,b^2\,x}{2}+\frac {C\,a^2\,x}{2}+C\,b^2\,x+\frac {3\,B\,a^2\,\sin \left (c+d\,x\right )}{4\,d}+\frac {B\,b^2\,\sin \left (c+d\,x\right )}{d}+B\,a\,b\,x+\frac {A\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {A\,a^2\,\sin \left (4\,c+4\,d\,x\right )}{32\,d}+\frac {A\,b^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {B\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {C\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {3\,A\,a\,b\,\sin \left (c+d\,x\right )}{2\,d}+\frac {2\,C\,a\,b\,\sin \left (c+d\,x\right )}{d}+\frac {A\,a\,b\,\sin \left (3\,c+3\,d\,x\right )}{6\,d}+\frac {B\,a\,b\,\sin \left (2\,c+2\,d\,x\right )}{2\,d} \]
[In]
[Out]